using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Flow : MonoBehaviour
{
    public Rigidbody2D rb;
    public int upForce;
    private void OnTriggerEnter2D(Collider2D collision)
    {
        rb = collision.gameObject.GetComponent<Rigidbody2D>();
    }

    private void OnTriggerStay2D(Collider2D collision)
    {
        rb.AddForce(Vector2.up * upForce, ForceMode2D.Force);
    }

    private void OnTriggerExit2D(Collider2D collision)
    {
        rb = null;
    }
}
